package pro.shushi.pamirs.demo.api.model;

import pro.shushi.pamirs.meta.annotation.Field;
import pro.shushi.pamirs.meta.annotation.Model;
import pro.shushi.pamirs.meta.base.common.VersionModel;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;


@Model.model(ProductPlan.MODEL_MODEL)
@Model(displayName = "班次", labelFields = "name")
public class ProductPlan extends VersionModel {

    private static final long serialVersionUID = -5104390780952631397L;

    public static final String MODEL_MODEL = "demo.ProductPlan";

    @Field.many2one
    @Field.Relation(relationFields = {"productId"}, referenceFields = {"id"})
    @Field(displayName = "产品")
    private Product product;

    @Field.Integer
    @Field(displayName = "产品id", invisible = true, index = true)
    private Long productId;

    @Field.String
    @Field(displayName = "班次名")
    private String name;

    @Field.Money(D = 2, min = "0.0")
    @Field(displayName = "显示价格")
    private BigDecimal settlementPrice;

    @Field.Money(D = 2, min = "0.0")
    @Field(displayName = "划线价")
    private BigDecimal underlinePrice;

    @Field.Date
    @Field(displayName = "开航时间")
    private Date consumeDate;


    @Field.Boolean
    @Field(displayName = "状态")
    private Boolean status;


    @Field.Boolean
    @Field(displayName = "是否可退")
    private Boolean refundFlag;


    @Field.one2many
    @Field(displayName = "库存")
    @Field.Relation(relationFields = "id",referenceFields = "productPlanId")
    private List<ProductStock> productStocks;

}
